package com.iflytek.exam.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.iflytek.exam.mapper.ChoiceMapper;
import com.iflytek.exam.domain.Choice;
import com.iflytek.exam.service.IChoiceService;

/**
 * 单选题添加Service业务层处理
 *
 * @author Dogdog
 * @date 2024-07-07
 */
@Service
public class ChoiceServiceImpl implements IChoiceService
{
    @Autowired
    private ChoiceMapper choiceMapper;

    /**
     * 查询单选题添加
     *
     * @param id 单选题添加主键
     * @return 单选题添加
     */
    @Override
    public Choice selectChoiceById(Long id)
    {
        return choiceMapper.selectChoiceById(id);
    }

    @Override
    public Choice selectChoiceByName(String name) {
        return choiceMapper.selectChoiceByName(name);
    }

    /**
     * 查询单选题添加列表
     *
     * @param choice 单选题添加
     * @return 单选题添加
     */
    @Override
    public List<Choice> selectChoiceList(Choice choice)
    {
        return choiceMapper.selectChoiceList(choice);
    }

    /**
     * 新增单选题添加
     *
     * @param choice 单选题添加
     * @return 结果
     */
    @Override
    public int insertChoice(Choice choice)
    {
        return choiceMapper.insertChoice(choice);
    }

    /**
     * 修改单选题添加
     *
     * @param choice 单选题添加
     * @return 结果
     */
    @Override
    public int updateChoice(Choice choice)
    {
        return choiceMapper.updateChoice(choice);
    }

    /**
     * 批量删除单选题添加
     *
     * @param ids 需要删除的单选题添加主键
     * @return 结果
     */
    @Override
    public int deleteChoiceByIds(Long[] ids)
    {
        return choiceMapper.deleteChoiceByIds(ids);
    }

    /**
     * 删除单选题添加信息
     *
     * @param id 单选题添加主键
     * @return 结果
     */
    @Override
    public int deleteChoiceById(Long id)
    {
        return choiceMapper.deleteChoiceById(id);
    }

    @Override
    public Long[] getAllChoiceRadioIds(long quBankId) {
        return choiceMapper.getAllChoiceRadioIds(quBankId);
    }

    @Override
    public Long[] getAllChoiceCheckIds(long quBankId) {
        return choiceMapper.getAllChoiceCheckIds(quBankId);
    }
}
